package cc.codeshop.net;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class IOUtils {

	public static void copyStream(InputStream is, OutputStream os) throws IOException {
		byte[] buff = new byte[1024];
		int len;
		while ((len = is.read(buff)) != -1) {
			os.write(buff, 0, len);
		}
	}

	public static void closeSilently(Closeable closeable) {
		try {
			closeable.close();
		} catch (IOException e) {
		}
	}

}
